package com.linwen.excise.niuke._60;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @author wlw
 * @date 2023/3/17 11:04 PM
 */
public class _58输入n个整数输出其中最小的k个 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int k = scanner.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = scanner.nextInt();
        }
        Arrays.sort(arr);
        for (int i = 0; i < k; i++) {
            System.out.print(arr[i]+" ");
        }
    }
}
